#pragma once

#include <stdio.h>
#include <errno.h>

#include <sys/time.h>

#define SERVER_PORT 8366

#define SEND_BLOCK_SIZE 1024
#define SEND_BLOCK_NUM 4096

#define SERVER_SEND_INVL_USEC 10000
#define CLIENT_HDLE_INVL_USEC 40000

#define SOCKET_WIN_SIZE 4096

#define PRINTF(fmt, ...) do{\
        struct timeval now;\
        gettimeofday(&now, NULL);\
        printf("E {line %d}[%ld.%ld]: " fmt "\n", __LINE__, now.tv_sec, now.tv_usec / 1000, ##__VA_ARGS__);\
    } while(0)
#define PERROR() printf("E {line %d}[%d]: %s\n", __LINE__, errno, strerror(errno))